

<%--项目流程管理页面--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<%@include file="/WEB-INF/include-head.jsp"%>
<security:csrfMetaTags/>
<head>





    <script type="text/javascript" src="ztree/jquery.ztree.all-3.5.min.js"></script>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>

    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/main.css">

    <link rel="stylesheet" href="css/pagination.css"/>
    <script type="text/javascript" src="jquery/jquery.pagination.js"></script>
    <script>
        $(function () {

            initPagination();

        });

        function  initPagination() {

            //1.获取总记录数 分页数据在PageInfo中
            var totalRecord=${requestScope.project_processInfo.total};

            //声明一个JSON对象存储Pagination要设置的数据
            var properties = {
                num_edge_entries: 3,								// 边缘页数
                num_display_entries: 5,								// 主体页数
                callback: pageSelectCallback,						// 指定用户点击“翻页”的按钮时跳转页面的回调函数
                items_per_page: ${requestScope.project_processInfo.pageSize},	// 每页要显示的数据的数量
                current_page: ${requestScope.project_processInfo.pageNum - 1},	// Pagination内部使用pageIndex来管理页码，pageIndex从0开始，pageNum从1开始，所以要减一
                prev_text: "上一页",									// 上一页按钮上显示的文本
                next_text: "下一页"
            }

            //2.生成页码导航条
            $("#Pagination").pagination(totalRecord,properties);

            // 回调函数的含义：声明出来以后不是自己调用，而是交给系统或框架调用
            // 用户点击“上一页、下一页、1、2、3……”这样的页码时调用这个函数实现页面跳转
            // pageIndex是Pagination传给我们的那个“从0开始”的页码 当pageNum用需要加1
            function pageSelectCallback(pageIndex, jQuery) {

                // 根据pageIndex计算得到pageNum
                var pageNum = pageIndex + 1;

                // 跳转页面
                window.location.href = "auth/member/page.html?pageNum="+pageNum+"&keyword=${param.keyword}";

                // 由于每一个页码按钮都是超链接，所以在这个函数最后取消超链接的默认行为
                return false;
            }

        }
    </script>
    <style>
        .tree li {
            list-style-type: none;
            cursor:pointer;
        }
        table tbody tr:nth-child(odd){background:#F4F4F4;}
        table tbody td:nth-child(even){color:#C00;}
    </style>

</head>



<body>
<%@ include file="/WEB-INF/include-nav.jsp"%>
<div class="container-fluid">
    <div class="row">
        <%@ include file="/WEB-INF/include-sidebar.jsp"%>
        <security:csrfMetaTags/>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> 数据列表</h3>
                </div>
                <div class="panel-body">

                    <form action="auth/project/page.html" class="form-inline" role="form" style="float:left;" method="post" >
                        <security:csrfMetaTags/>
                        <div class="form-group has-feedback">
                            <div class="input-group">
                                <div class="input-group-addon">查询条件</div>
                                <input class="form-control has-success" type="text" placeholder="请输入查询条件">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-warning"><i class="glyphicon glyphicon-search"></i> 查询</button>
                    </form>
                    <br>
                    <hr style="clear:both;">
                    <div class="table-responsive">
                        <table class="table  table-bordered">
                            <thead>
                            <tr >
                                <th width="30">#</th>
                                <th>流程名称</th>
                                <th>项目名称</th>
                                <th>发起人</th>
                                <th width="100">操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            <%--                                        暂时使用admin-page页面的 充数--%>
                            <c:if test="${empty sessionScope.project_processInfo.list }">
                                <tr>
                                    <td colspan="8" align="center">抱歉！没有查询到您要的数据！</td>
                                </tr>
                            </c:if>
                            <p>${sessionScope.message}</p>


                            <c:if test="${!empty sessionScope.project_processInfo.list }">
                                <%--                                有数据 遍历显示--%>
                                <c:forEach items="${sessionScope.project_processInfo.list }" var="project" varStatus="myStatus">
                                   <script>
                                   </script>
                                    <tr>
                                        <td>${myStatus.count }</td>
                                        <td>${project. statusText}</td>
                                        <td>${project.projectName }</td>
                                        <td>${project.realname }</td>

                                        <td>
                                            <a class="btn btn-success btn-xs" href="project/process/update/page.html?projectId=${project.id}">
                                                <!--							点击修改 对项目进行管理-->
                                                <i class="glyphicon glyphicon glyphicon-pencil"></i>
                                            </a>
                                        </td>

                                    </tr>
                                </c:forEach>
                            </c:if>

                            </tbody>

                            <tfoot>
                            <tr>
                                <td colspan="6" align="center">
                                    <div id="Pagination" class="pagination"><!-- 这里显示分页 --></div>
                                </td>
                            </tr>


                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


</div>
</div>
</div>

<%--引入展示模态框--%>
<%--<%@include file="/WEB-INF/model-auth-member.jsp"%>--%>
</body>
</html>
